{extend name="default/base" /}
{block name="main"}
<style>
#mainTable{width:95%;text-align:center;border:1px solid #eee;margin: 0px auto;margin-bottom:40px;font-size:13px;}
.wst-list .num{text-align:center;}
.wst-list tr th{background:#f5f5f5;border-bottom:1px solid #eee;}
.wst-list tr td,.wst-list tr th {height: 35px;line-height: 35px;}
.wst-list tr td{border-bottom:1px dotted #eee;}
.wst-list tbody tr:hover{background:#f5f5f5;}
</style>
<div class='wst-toolbar'>
    <span style="float: left; line-height: 40px">日期：</span><input type='text' class="laydate-icon j-ipt" id='startDate' value='{$startDate}'/> <span style="float: left; line-height: 40px">至</span>
    <input type='text' class="laydate-icon j-ipt" id='endDate' value='{$endDate}'/>
    <a class="s-btn btn btn-primary" onclick="loadStat()"><i class="fa fa-search"></i>查询</a>
    <a class="s-btn btn btn-primary f-right" onclick="toExport()"><i class="fa fa-sign-in"></i>导出</a>
</div>
<div class='wst-grid'>
    <div id='main' style='height:400px;width:99%'></div>
    <table id='mainTable' class='wst-list hide'>
        <thead>
            <tr>
              <th width='20'>&nbsp;&nbsp;</th>
              <th width='100'>日期</th>
              <th width='100'>待付款订单</th>
              <th width='100'>取消订单</th>
              <th width='130'>拒收订单</th>
              <th width='130'>正常订单</th>
              <th width='130'>总订单</th>
            </tr>
        </thead>
        <tbody id='list-box'></tbody>
        <script id="stat-tblist" type="text/html">
        {{# for(var i = 0; i < d.length; i++){ }}
            <tr>
              <td class='num'>{{(i+1)}}</td>
              <td>{{ d[i].day }}</td>
              <td>{{ d[i].of2 }}</td>
              <td>{{ d[i].o1 }}</td>
              <td>{{ d[i].o3 }}</td>
              <td>{{ d[i].ou }}</td>
              <td>{{ d[i].of2+d[i].o1+d[i].o3+d[i].ou }}</td>
            </tr>
        {{# } }}
        </script>
    </table>
</div>
{/block}  
{block name="js"}
<script src="__STATIC__/plugins/echarts/echarts.min.js?v={$v}" type="text/javascript"></script>
<script type='text/javascript' src='__SHOP__/reports/stat_orders.js?v={$v}'></script>
<script>$(function(){
  var laydate = layui.laydate;
    laydate.render({
        elem: '#startDate'
    });
    laydate.render({
        elem: '#endDate'
    });
  loadStat();
})
</script>
{/block}